home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / 3DDEMO.ZIP / 3D / INCLUDE / BMAPGFX.HPP next >
C/C++ Source or Header  |  1996-07-21  |  1KB  |  54 lines

  1. #ifndef __BMAPGFX__
  2.  
  3. #include <math.h>
  4. #include "video.hpp"
  5.  
  6. // Copyright (c) 1996 by Kerrigan Burgess, all rights reserved.
  7.  
  8.  
  9. extern void Error(char *fmt, ...);
  10.  
  11. extern "C" {
  12. extern long           _MinClipX,_MinClipY,_MaxClipX,_MaxClipY;
  13. extern unsigned char *_RendBuffer;
  14. }
  15.  
  16. extern int   SCREENWIDTH;
  17. extern int   SCREENHEIGHT;
  18. extern int   HALF_SCREEN_WIDTH;
  19. extern int   HALF_SCREEN_HEIGHT;
  20.  
  21. typedef struct _2dpointyp {
  22.     float x,y;
  23.     int u,v;
  24. } POINT2D;
  25.  
  26. class BITMAPGFXCLASS {
  27.  
  28.  private:
  29.   
  30.   POINT2D  Coords[4];
  31.   unsigned char *Image;
  32.   int MidX,MidY;           // holds mid-point of image.
  33.  
  34.   void ScaleBitMap(int x0,int y0,int x2,int y2,
  35.                    int u0,int v0,int u2,int v2,
  36.                    unsigned char *Buffer,unsigned char *Image);
  37.                
  38.   void RotateBitMap(int x0,int y0,int x1,int y1,int x2,int y2,
  39.                     int u0,int v0,int u1,int v1,int u2,int v2,
  40.                      unsigned char *Buffer,unsigned char *Image);
  41.  public:
  42.  
  43.   BITMAPGFXCLASS(void);
  44.   ~BITMAPGFXCLASS(void);
  45.  
  46.   void Create( ImageStats *Stats, unsigned char *bitmap );
  47.   void Rotate( unsigned char *Buffer, double angle, float scale );
  48.   void Scale( unsigned char *Buffer, float percentage );
  49.  
  50. };
  51.  
  52. #define __BMAPGFX__
  53. #endif
  54.